//
//  Menu.m
//  ServiceApp
//
//  Created by User-23 on 12/15/14.
//  Copyright (c) 2014 TrainingCamp. All rights reserved.
//

#import "Menu.h"

@interface Menu ()

@property NSMutableArray* categories;

@end

@implementation Menu

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.categories = [[NSMutableArray alloc] init];
    }
    return self;
}

- (NSInteger) count{
    return [self.categories count];
}

- (void) addSubCategory:(SubCategory*) subCat{
    if (subCat && [subCat isKindOfClass:[SubCategory class]]) {
        [self.categories addObject:subCat];
    }
}

- (SubCategory*) categoryAtIndex:(NSInteger) index{
    if (index > -1 && index < [self count]) {
        return self.categories[index];
    }
    else{
        return nil;
    }
}

@end
